package com.chapter0.string;


/**
 * String转换为 整数类型   和  浮点类型
 */
public class test4 {
    public static void main(String[] args) {
        String s="123";
        byte b = Byte.parseByte( s );
        short t = Short.parseShort( s );
        int i = Integer.parseInt( s );
        long l = Long.parseLong( s );
        Float f = Float.parseFloat( s );
        Double d = Double.parseDouble( s );
        System.out.println(b);
        System.out.println(t);
        System.out.println(i);
        System.out.println(l);
        System.out.println(f);
        System.out.println(d);
    }
}
